<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>Gerenciador de Estoque - Cadastro de Produtos Prontos</title>
    </h:head>
    <h:body>
        <center>            
            <h:graphicImage id="logo" width="350" height="200" url="http://static.wixstatic.com/media/f3611f_f23a8ea76443e56fddfeca51f456962a.png"/>
            <br/>
            <h:outputText value="Controle de Estoque" style="font-size: 50px; font-style: oblique"/>
            <br/>
            <br/>
            <h:form>
                <h:panelGrid columns="2">
                    Ingredientes: <h:selectOneListbox id="ingredientes" value="#{ingredientesBean.p}">
                        <f:selectItems value="#{produtoBean.listaprodutos}" var="itens" itemValue="#{itens}" itemLabel="#{itens.nome}"/>                        
                    </h:selectOneListbox>
                    Quantidade: <h:inputText value="#{ingredientesBean.quantidade}" id="quantidade"/>
                    <h:inputHidden /><h:commandButton value="Adicionar Ingrediente" action="#{ingredientesBean.addIngredientes}"/>
                </h:panelGrid>
                <br/>
                <h:dataTable id="ingredientesTable" value="#{ingredientesBean.listaIngredientes}" var="in">
                    <h:column>
                        <f:facet name="header">NOME</f:facet>
                        #{in.produto}
                    </h:column>
                    <h:column>
                        <f:facet name="header">QNT</f:facet>
                        #{in.quantidade}
                    </h:column>
                </h:dataTable>
            </h:form>

            <br/><h:form><h:commandLink value="((( Cancelar e Voltar )))" action="index"/></h:form>
        </center>
    </h:body>
</html>

